<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <title>ECharts</title>
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="height:400px"></div>
    <!-- ECharts单文件引入 -->
    <script src="http://echarts.baidu.com/build/dist/echarts.js"></script>
    <script type="text/javascript">
        // 路径配置
        require.config({
            paths: {
                echarts: 'http://echarts.baidu.com/build/dist'
            }
        });
        
       
        
        require(
	[
	 'echarts',
	 'echarts/chart/bar'
	 ],
	function (ec) {
		var myChart = ec.init(document.getElementById('main'));
		
		var option = {
			tooltip: {
				show:true
			},
			legend: {
				data:['销量']
			},
			xAxis: [
			        {
			        	type: 'category',
			        	data: ["开", "什", "么", "玩", "笑"]
			        }],
			yAxis: [{type: 'value'}],
			series: [{
				name: '销量',
				type: 'bar',
				data: [5, 20, 40, 30, 10]
			}]
		};
		
		myChart.setOption(option);
	}
);
    </script>
</body>